package com.yanlight.app.request;

import com.yanlight.util.WxEncryptUtil;

import java.util.SortedMap;
import java.util.TreeMap;

public class ApplyMiniRequest {

    private String version = "3.0";

    //证书序列号
    private String cert_sn;

    //服务商的商户号
    private String mch_id;

    //自定义随机字符串
    private String nonce_str;

    //HMAC-SHA256
    private String sign_type = "HMAC-SHA256";

    private String sign;

    //服务商自定义的商户唯一编号。每个编号对应一个申请单，每个申请单审核通过后会生成一个微信支付商户号。
    private String business_code;

    //身份证人像面MediaId
    private String id_card_copy;

    //身份证国徽面MediaId
    private String id_card_national;

    //身份证上的姓名
    private String id_card_name;

    //身份证号
    private String id_card_number;

    //身份证有效期
    private String id_card_valid_time;

    //开户名称
    private String account_name;

    //开户银行名称
    private String account_bank;

    //开户银行省市编码
    private String bank_address_code;

    //开户银行全称（含支行） 非必要字段
    private String bank_name;

    //开户行卡号 有不支持的银行
    private String account_number;

    //门店名称
    private String store_name;

    //门店省市编码
    private String store_address_code;

    //门店街道名称
    private String store_street;

    //门店经度
    private String store_longitude;

    //门店维度
    private String store_latitude;

    //门店门口照片
    private String store_entrance_pic;

    //店内环境照片
    private String indoor_pic;

    //经营场地证明 非必要
    private String address_certification;

    //商户简称
    private String merchant_shortname;

    //客服电话
    private String service_phone;

    //售卖商品/提供服务描述
    //
    // 餐饮
    //
    //线下零售
    //
    //居民生活服务
    //
    //休闲娱乐
    //
    //交通出行
    //
    //其他
    private String product_desc;

    //费率
    private String rate = "0.6%";

    //补充说明 非必要字段
    private String business_addition_desc;

    //补充材料
    private String business_addition_pics;

    //联系人姓名
    private String contact;

    //手机号
    private String contact_phone;

    //联系邮箱 非必要字段
    private String contact_email;


    public SortedMap<String, String> setupParams() {
        SortedMap<String, String> paramsMap = new TreeMap<>();

        paramsMap.put("version", getVersion());
        paramsMap.put("cert_sn", getCert_sn());
        paramsMap.put("mch_id", getMch_id());

        paramsMap.put("nonce_str", getNonce_str());
        paramsMap.put("sign_type", getSign_type());
        paramsMap.put("business_code", getBusiness_code());

        paramsMap.put("id_card_copy", getId_card_copy());
        paramsMap.put("id_card_national", getId_card_national());
        paramsMap.put("id_card_name", getId_card_name());

        paramsMap.put("id_card_number", getId_card_number());
        paramsMap.put("id_card_valid_time", getId_card_valid_time());
        paramsMap.put("account_name", getAccount_name());

        paramsMap.put("account_bank", getAccount_bank());
        paramsMap.put("bank_address_code", getBank_address_code());
        paramsMap.put("account_number", getAccount_number());

        paramsMap.put("store_name", getStore_name());
        paramsMap.put("merchant_shortname", getMerchant_shortname());
        paramsMap.put("store_street", getStore_street());
        paramsMap.put("store_longitude", getStore_longitude());
        paramsMap.put("store_latitude", getStore_latitude());
        paramsMap.put("store_address_code", getStore_address_code());

        paramsMap.put("store_entrance_pic", getStore_entrance_pic());
        paramsMap.put("indoor_pic", getIndoor_pic());

        paramsMap.put("service_phone", getService_phone());
        paramsMap.put("product_desc", getProduct_desc());
        paramsMap.put("rate", getRate());
        paramsMap.put("contact", getContact());
        paramsMap.put("contact_phone", getContact_phone());
        paramsMap.put("contact_email", getContact_email());
        return paramsMap;
    }

    public void rsaEncryptParam() {
        this.id_card_name = WxEncryptUtil.rsaEncrypt(this.id_card_name);
        this.id_card_number = WxEncryptUtil.rsaEncrypt(this.id_card_number);
        this.account_name = WxEncryptUtil.rsaEncrypt(this.account_name);
        this.account_number = WxEncryptUtil.rsaEncrypt(this.account_number);
        this.contact = WxEncryptUtil.rsaEncrypt(this.contact);
        this.contact_phone = WxEncryptUtil.rsaEncrypt(this.contact_phone);
        this.contact_email = WxEncryptUtil.rsaEncrypt(this.contact_email);
    }


    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getCert_sn() {
        return cert_sn;
    }

    public void setCert_sn(String cert_sn) {
        this.cert_sn = cert_sn;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign_type() {
        return sign_type;
    }

    public void setSign_type(String sign_type) {
        this.sign_type = sign_type;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getBusiness_code() {
        return business_code;
    }

    public void setBusiness_code(String business_code) {
        this.business_code = business_code;
    }

    public String getId_card_copy() {
        return id_card_copy;
    }

    public void setId_card_copy(String id_card_copy) {
        this.id_card_copy = id_card_copy;
    }

    public String getId_card_national() {
        return id_card_national;
    }

    public void setId_card_national(String id_card_national) {
        this.id_card_national = id_card_national;
    }

    public String getId_card_name() {
        return id_card_name;
    }

    public void setId_card_name(String id_card_name) {
        this.id_card_name = id_card_name;
    }

    public String getId_card_number() {
        return id_card_number;
    }

    public void setId_card_number(String id_card_number) {
        this.id_card_number = id_card_number;
    }

    public String getId_card_valid_time() {
        return id_card_valid_time;
    }

    public void setId_card_valid_time(String id_card_valid_time) {
        this.id_card_valid_time = id_card_valid_time;
    }

    public String getAccount_name() {
        return account_name;
    }

    public void setAccount_name(String account_name) {
        this.account_name = account_name;
    }

    public String getAccount_bank() {
        return account_bank;
    }

    public void setAccount_bank(String account_bank) {
        this.account_bank = account_bank;
    }

    public String getBank_address_code() {
        return bank_address_code;
    }

    public void setBank_address_code(String bank_address_code) {
        this.bank_address_code = bank_address_code;
    }

    public String getBank_name() {
        return bank_name;
    }

    public void setBank_name(String bank_name) {
        this.bank_name = bank_name;
    }

    public String getAccount_number() {
        return account_number;
    }

    public void setAccount_number(String account_number) {
        this.account_number = account_number;
    }

    public String getStore_name() {
        return store_name;
    }

    public void setStore_name(String store_name) {
        this.store_name = store_name;
    }

    public String getStore_address_code() {
        return store_address_code;
    }

    public void setStore_address_code(String store_address_code) {
        this.store_address_code = store_address_code;
    }

    public String getStore_street() {
        return store_street;
    }

    public void setStore_street(String store_street) {
        this.store_street = store_street;
    }

    public String getStore_longitude() {
        return store_longitude;
    }

    public void setStore_longitude(String store_longitude) {
        this.store_longitude = store_longitude;
    }

    public String getStore_latitude() {
        return store_latitude;
    }

    public void setStore_latitude(String store_latitude) {
        this.store_latitude = store_latitude;
    }

    public String getStore_entrance_pic() {
        return store_entrance_pic;
    }

    public void setStore_entrance_pic(String store_entrance_pic) {
        this.store_entrance_pic = store_entrance_pic;
    }

    public String getIndoor_pic() {
        return indoor_pic;
    }

    public void setIndoor_pic(String indoor_pic) {
        this.indoor_pic = indoor_pic;
    }

    public String getAddress_certification() {
        return address_certification;
    }

    public void setAddress_certification(String address_certification) {
        this.address_certification = address_certification;
    }

    public String getMerchant_shortname() {
        return merchant_shortname;
    }

    public void setMerchant_shortname(String merchant_shortname) {
        this.merchant_shortname = merchant_shortname;
    }

    public String getService_phone() {
        return service_phone;
    }

    public void setService_phone(String service_phone) {
        this.service_phone = service_phone;
    }

    public String getProduct_desc() {
        return product_desc;
    }

    public void setProduct_desc(String product_desc) {
        this.product_desc = product_desc;
    }

    public String getRate() {
        return rate;
    }

    public void setRate(String rate) {
        this.rate = rate;
    }

    public String getBusiness_addition_desc() {
        return business_addition_desc;
    }

    public void setBusiness_addition_desc(String business_addition_desc) {
        this.business_addition_desc = business_addition_desc;
    }

    public String getBusiness_addition_pics() {
        return business_addition_pics;
    }

    public void setBusiness_addition_pics(String business_addition_pics) {
        this.business_addition_pics = business_addition_pics;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getContact_phone() {
        return contact_phone;
    }

    public void setContact_phone(String contact_phone) {
        this.contact_phone = contact_phone;
    }

    public String getContact_email() {
        return contact_email;
    }

    public void setContact_email(String contact_email) {
        this.contact_email = contact_email;
    }

}
